<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@include file="/include/common/gridbackhead.jsp"%>
<%!
private class PageAction extends BaseAction{
	ResultSet rs = null;
	
	//准备action的环境变量 每次请次都会执行此方法 可在此方法中初如化一些变量
	protected void prepareActionEnv() throws Exception{
		
	}
	
	//加載頁面默認數據
	protected boolean onLoadDefault() throws Exception{
		onSearchRetrieveResult();
		return true ;
	}
	
	// 取出查询結果
	protected void onSearchRetrieveResult() throws Exception{
		String sql = onSearchGetSql();
		if(sql == null){ret.setErrorInfo("查询语句异常,请联系资讯部!");return;}
		rs = utils.executeQuery("fs1",sql);
		ret.SetSearchResult(rs);
	}

	//取出查詢語句
	protected String onSearchGetSql() throws Exception{
		StringBuilderEx sql =  new StringBuilderEx("select * from pan..pan001 where 1=1");
		if(!form.isNullOrEmpty("userid")){
	sql.Append(" and userid like '%%%1$s%%' ",form.gpsv("userid"));
}

if(!form.isNullOrEmpty("chname")){
	sql.Append(" and chname like '%%%1$s%%' ",form.gpsv("chname"));
}
		return sql.toString();
	}

}
%>
<%@include file="/include/common/gridbackend.jsp"%>
